﻿//-------------------------------------------------------------------------------------------------
// <copyright file="ClassHandlers.cs" company="Anthony Adam">
// Copyright (c) Anthony Adam 2012. All rights reserved.
// </copyright>
//-------------------------------------------------------------------------------------------------
// ReSharper disable once CheckNamespace
namespace SuperStarRounds
{
  using System.Windows.Forms;

  using Models;

  /// <summary>
  /// Utility class containing the skill choice control population functions.
  /// </summary>
  public static class ClassHandlers
  {
    /// <summary>
    /// Sets the current content selected in the application using the check marks
    /// on the select content check boxes tab.
    /// </summary>
    /// <param name="settings">Content Configuration settings</param>
    /// <param name="comboBox">The choice control to be populated</param>
    public static void SetClassList(ContentInclusions settings, ComboBox comboBox)
    {
      comboBox.Items.Clear();

      AddClass(settings.AdvpgAlc, comboBox, "Alchemist");
      AddClass(settings.AdvpgAnt, comboBox, "AntiPaladin");
      AddClass(settings.AdvcgArc, comboBox, "Arcanist");
      AddClass(settings.CoreBrb, comboBox, "Barbarian");
      AddClass(settings.CoreBar, comboBox, "Bard");
      AddClass(settings.AdvcgBlo, comboBox, "Bloodrager");
      AddClass(settings.AdvcgBra, comboBox, "Brawler");
      AddClass(settings.AdvpgCav, comboBox, "Cavalier");
      AddClass(settings.CoreCle, comboBox, "Cleric");
      AddClass(settings.CoreDru, comboBox, "Druid");
      AddClass(settings.CoreFig, comboBox, "Fighter");
      AddClass(settings.UltCoGun, comboBox, "Gunslinger");
      AddClass(settings.AdvcgHun, comboBox, "Hunter");
      AddClass(settings.AdvpgInq, comboBox, "Inquisitor");
      AddClass(settings.AdvcgInv, comboBox, "Investigator");
      AddClass(settings.OccKin, comboBox, "Kineticist");
      AddClass(settings.UltMaMag, comboBox, "Magus");
      AddClass(settings.OccMed, comboBox, "Medium");
      AddClass(settings.OccMes, comboBox, "Mesmerist");
      AddClass(settings.CoreMon, comboBox, "Monk");
      AddClass(settings.UltCoNin, comboBox, "Ninja");
      AddClass(settings.OccOcc, comboBox, "Occultist");
      AddClass(settings.AdvpgOra, comboBox, "Oracle");
      AddClass(settings.CorePal, comboBox, "Paladin");
      AddClass(settings.OccPsy, comboBox, "Psychic");
      AddClass(settings.CoreRan, comboBox, "Ranger");
      AddClass(settings.CoreRog, comboBox, "Rogue");
      AddClass(settings.UltCoSam, comboBox, "Samurai");
      AddClass(settings.AdvcgSha, comboBox, "Shaman");
      AddClass(settings.AdvcgSka, comboBox, "Skald");
      AddClass(settings.AdvcgSla, comboBox, "Slayer");
      AddClass(settings.CoreSor, comboBox, "Sorceror");
      AddClass(settings.OccSpi, comboBox, "Spiritualist");
      AddClass(settings.AdvpgSum, comboBox, "Summoner");
      AddClass(settings.AdvcgSwa, comboBox, "Swashbuckler");
      AddClass(settings.AdvcgWar, comboBox, "Warpriest");
      AddClass(settings.AdvpgWit, comboBox, "Witch");
      AddClass(settings.CoreWiz, comboBox, "Wizard");

      if (comboBox.Items.Count > 0)
        comboBox.SelectedIndex = 0;
      else
        comboBox.Text = string.Empty;
    }

    private static void AddClass(bool addIt, ComboBox comboBox, string classToAdd)
    {
      if (addIt)
      {
        comboBox.Items.Add(classToAdd);
      }
    }
  }
}